home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.19960425-19960715 / 000277_news@columbia.edu _Thu Jun 20 19:52:43 1996.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Return-Path: news@columbia.edu
  2. Received: from apakabar.cc.columbia.edu (apakabar-ether.cc.columbia.edu [128.59.40.159]) by watsun.cc.columbia.edu (8.7.5/8.7.3) with ESMTP id TAA05935 for <kermit.misc@watsun.cc.columbia.edu>; Thu, 20 Jun 1996 19:52:42 -0400 (EDT)
  3. Received: (from news@localhost) by apakabar.cc.columbia.edu (8.7.5/8.7.3) id TAA17753 for kermit.misc@watsun; Thu, 20 Jun 1996 19:52:39 -0400 (EDT)
  4. Path: news.columbia.edu!watsun.cc.columbia.edu!fdc
  5. From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
  6. Newsgroups: comp.protocols.kermit.misc
  7. Subject: Re: output command not working
  8. Date: 20 Jun 1996 23:52:34 GMT
  9. Organization: Columbia University
  10. Lines: 49
  11. Message-ID: <4qco82$hal@apakabar.cc.columbia.edu>
  12. References: <01bb59a9.369fad80$9606848b@rmstephe.deakin.edu.au> <4prqns$jh3@apakabar.cc.columbia.edu> <01bb5a7d.c2679240$0f02000a@rana.deakin.edu.au> <31C9B639.E87@genmagic.com>
  13. NNTP-Posting-Host: watsun.cc.columbia.edu
  14.  
  15. In article <31C9B639.E87@genmagic.com>,
  16. William Mills  <mills@genmagic.com> wrote:
  17. : I was having similar problems,  even testing parts of teh 
  18. : script and when I put them all together they broke.
  19. : I found that frequent pauses of good size at the significant 
  20. : points like after you log in, made it work.  I shove a pause 
  21. : 10 in there and lo-and-behold it works.
  22. : Seems faster when testing by hand, but the script needs it I 
  23. : guess.
  24. PAUSE 10 (seconds) might be a little excessive, but yes, sometimes
  25. pauses are necessary.  In the most common example, the computer
  26. prompts for a password and then waits for you to type your password.
  27. But it does NOT allow you to type ahead (this is a security feature).
  28. Thus it does something like this:
  29.  
  30.   Print "Password:"
  31.   Clear input buffer
  32.   Read password from user
  33.  
  34. Clearing the input buffer takes some time, usually imperceptible to
  35. a human, but if a script sees "Password:" and responds instantly,
  36. the text could start to arrive while the computer is still clearing
  37. its buffer, and so the first few characters can be lost.
  38.  
  39. So (remembering that we must never store passwords in a file), here
  40. is a typical login script:
  41.   
  42.   def \%p
  43.   while not def \%p { 
  44.       askq \%p {Please type your password: }
  45.   }
  46.   ;
  47.   ; Put commands here to make the connection
  48.   ;  
  49.   input 10 login:                ; (or whatever)
  50.   if fail ...                    ; (handle failure here)
  51.   output myuserid\13             ; (replace with your actual ID)
  52.   input 10 Password:             ; (or whatever)
  53.   if fail ...                    ; (handle failure here)
  54.   pause 1                        ; (or longer if necessary)
  55.   output \%p\13                  ; send password
  56.   def \%p                        ; erase this from memory
  57.  
  58. and then CONNECT or whatever else you want to do next.
  59.  
  60. - Frank